# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-httplib2
_pkgname=httplib2
pkgver=0.18.1
pkgrel=2
pkgdesc='A comprehensive HTTP client library.'
url='https://pypi.org/project/httplib2/#files'
arch=('any')
license=('MIT')
depends=('python2' 'ca-certificates')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
        'certs.py.patch')
sha512sums=('a1bb527279bdc92fb75bffebc317ff549bb6efb678580cbe40d187921b7ace66b1a5bc1d98bdf065ec5667fe69632da086b0eb201ff911497324fd817bfe1b7a'
            'c1d468c7109ecb1f3d7d612684394cb42349493b4b9ed97f072c5ef3e3586c1a73a79bf0a34c5bc0c823bf6260b5810338ae5949e130e1c0091a5cc15c9957d5')

prepare() {
  cd "$_pkgname-$pkgver/"

  patch -p2 < ../certs.py.patch
}

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

